package com.atguigu.petstore.pets.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 宠物-标签
 * @TableName pets_tag
 */
@TableName(value ="pets_tag")
@Data
public class PetsTag implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 标签名
     */
    @TableField(value = "tag_name")
    private String tagName;

    /**
     * 标签颜色：如：#c1c1c1
     */
    @TableField(value = "tag_color")
    private String tagColor;

    /**
     * 00：全类型   10: 狗狗   20: 猫猫
     */
    @TableField(value = "tag_adapt_type")
    private Integer tagAdaptType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PetsTag other = (PetsTag) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTagName() == null ? other.getTagName() == null : this.getTagName().equals(other.getTagName()))
            && (this.getTagColor() == null ? other.getTagColor() == null : this.getTagColor().equals(other.getTagColor()))
            && (this.getTagAdaptType() == null ? other.getTagAdaptType() == null : this.getTagAdaptType().equals(other.getTagAdaptType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTagName() == null) ? 0 : getTagName().hashCode());
        result = prime * result + ((getTagColor() == null) ? 0 : getTagColor().hashCode());
        result = prime * result + ((getTagAdaptType() == null) ? 0 : getTagAdaptType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", tagName=").append(tagName);
        sb.append(", tagColor=").append(tagColor);
        sb.append(", tagAdaptType=").append(tagAdaptType);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}